from django.http import JsonResponse,HttpResponse
from django.shortcuts import render, redirect

# Create your views here.
from django.urls import reverse
from django.views import View


class Index(View):
    def get(self,request):
        c = JsonResponse({'s':1})
        c.set_cookie('name','xx',max_age=100)

        return c
class Index1(View):
    def get(self,request):
        return redirect(reverse('user:index'))
class Index2(View):
    def get(self,request):
        c = request.COOKIES
        c.get('naem')
        return JsonResponse({'C':c})